<?php

namespace api\web\validate;

use think\Validate;
class AddressValidate extends Validate
{
    //定义验证规则
    protected $rule = [
        'mobile' => 'require|mobile',
        'address' => 'require',
        'location' => 'require',
        'name'=>'require'
    ];
    //定义验证失败时的提示信息
    protected $message = [
        'name.require' => '名称不为空',
        'mobile.require' => '手机号不能为空',
        'location.require' => '所在地不能为空',
        'address.require' => '详细地址不能为空',
    ];

    //验证场景
    protected  $scene = [
        'add' => ['mobile','address','location','name'],
        'edit' => ['address','mobile','location','name'],
    ];
}